package com.github.tangmonkmeat;

/**
 * Description:
 *
 * @author zwl
 * @version 1.0
 * @date 2021/8/7 下午7:31
 */
public class 最少硬币 {

    public static void main(String[] args) {
        int i = GetCoinCount(200);
        System.out.println(i);
    }

    public static int GetCoinCount (int N) {
        // write code here
        int count = 0;
        N = 1024 - N;

        int yu = N % 64;
        N = N / 64;
        count += N;

        N = yu / 16;
        yu = yu % 16;
        count += N;

        N = yu / 4;
        yu = yu % 4;
        count += N;

        count += yu;
        return count;
    }

}

